package protocol;

import play.Logger;
import play.Play;
import play.libs.Codec;
import play.vfs.VirtualFile;
import org.apache.commons.lang.StringUtils;

import java.io.IOException;
import java.util.Properties;

/**
 * 签名处理类
 * 
 * @author yangzhi@djcars.cn
 * @createDate 2012-8-23
 * 
 */
public class SignHandler {

    /**
     * 计算签名，新方法
     *
     * @param caller
     * @param key
     * @param paramString
     * @return
     */
    public static String computeSign(String caller, String key, String paramString) {
        if (StringUtils.isEmpty(caller) || StringUtils.isEmpty(key)) {
            throw new IllegalArgumentException("the caller and key must not be empty");
        }
        return Codec.hexMD5(caller + paramString + key);
    }


}
